import Vue from 'vue'
import Router from 'vue-router'
Vue.use(Router)
export default new Router({
  routes: [
    { path: '/', redirect: '/tabbar' },
    {
      path: '/tabbar',
      name: 'Tabbar',
      redirect: { name: 'Home' },
      component: () => import('@/views/Tabbar/index.vue'),//index 页面
      children: [
        // home首页
        { path: 'home', name: 'Home', component: () => import('@/views/Tabbar/home.vue') },
        // 购物车
        { path: 'cart', name: 'Cart', component: () => import('@/views/Tabbar/Cart.vue') },
        // 分类
        { path: 'sort', name: 'Sort', component: () => import('@/views/Tabbar/sort.vue') },
        // 用户页面
        {
          path: 'user', name: 'User', meta: { title: '用户' }, component: () => import('@/views/Tabbar/user.vue')
        },

      ]
    },

    // 搜索页面页面
    {
      path: '/search', name: 'Search',
      component: () => import('@/views/Tabbar/search/search.vue'),
    },
    // 登录页面页面
    { path: '/login', name: 'Login', component: () => import('@/views/Tabbar/login/login.vue') },
    // 注册页面页面
    { path: '/register', name: 'Register', component: () => import('@/views/Tabbar/register/register.vue') },
    // 忘记密码页面
    { path: '/forgotpassword', name: 'Forgotpassword', component: () => import('@/views/Tabbar/ForgotPassword/Forgotpassword.vue') },
    // 修改个人信息页面
    { path: '/modifyinformation', name: 'ModifyInformation', component: () => import('@/views/Tabbar/ModifyInformation/ModifyInformation.vue') },
    // 商品详情页
    { path: '/goodsdetailspage', name: 'goodsDetailsPage', component: () => import('@/views/Tabbar/goodsDetailsPage/goodsDetailsPage.vue') },
    // 全部商品评价详情页
    { path: '/evaluationpage', name: 'Evaluationpage', component: () => import('@/views/Tabbar/Evaluationpage/Evaluationpage.vue') },
    // 商品收藏页
    { path: '/goodscollection', name: 'goodsCollection', component: () => import('@/views/Tabbar/goodsCollection/goodsCollection.vue') },
    // 立即购买页
    { path: '/Confirmorder', name: 'Confirmorder', component: () => import('@/views/Tabbar/Confirmorder/Confirmorder.vue') },
  ]
})
